package com.yonyou.isv.demo.openapi.api.salearea;

import com.yonyou.isv.demo.openapi.base.module.reponse.ApiDataArrayResponse;
import com.yonyou.isv.demo.openapi.base.module.reponse.ApiDataResponse;
import com.yonyou.isv.demo.openapi.api.BaseOpenApi;
import com.yonyou.isv.demo.openapi.api.OpenApiURL;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

/**
 * @description: 用友销售区域开放平台接口
 * @author: zpp
 * @create: 2021-08-10
 **/
@Component
public class SaleAreaApi extends BaseOpenApi {
    public Map<String,Object> save(Map<String,Object> params)
    {
        ApiDataResponse apiDataResponse = postForEntity(OpenApiURL.SALEAREA_SAVE, params, ApiDataResponse.class);
        return getData(apiDataResponse);
    }
    public List<Map<String,Object>> tree(Map<String,Object> params)
    {
        ApiDataArrayResponse apiDataResponse = postForEntity(OpenApiURL.SALEAREA_TREE, params, ApiDataArrayResponse.class);
        return getData(apiDataResponse);
    }
    public Map<String,Object> detail(Map<String,String> params)
    {
        ApiDataResponse apiDataResponse = getForEntity(OpenApiURL.SALEAREA_DETAIL, params, ApiDataResponse.class);
        return getData(apiDataResponse);
    }
}
